<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
</head>
    <body>
        <div class="divForm">
            <form action="/doLogin" method="post" name="form1" onsubmit="return on_submit()">
            <p>
            <h2>欢迎登录</h2>
            </p>
            <p>
                <b>账 号：</b><input type="text" name="userName"/>
            </p>
            <p>
                <b>密  码：</b><input type="password" name="passWord"/>
            </p>
            <input type="submit" value="登录"/>
            <input type="reset" value="清除"/>
            <br><br>
            </form>
        </div>
    </body>
    <script language="javascript">
        function on_submit()
        {//验证数据的合法性
            if (form1.userName.value == "")
            {
                alert("账号不能为空，请输入账号！");
                form1.userName.focus();
                return false;
            }
            if (form1.passWord.value == "")
            {
                alert("密码不能为空，请输入密码！");
                form1.passWord.focus();
                return false;
            }
        }
    </script>
</html>